<?php defined('SYSPATH') OR die('No direct access allowed.');
/**
  * Licence Agreement
*/

/**
  * User Controller
*/

class Security extends Kohana_Security {
  /**
   * Generates a version 4 UUID as per RFC 4122
   *
   * @link http://www.ietf.org/rfc/rfc4122.txt
   * @return string UUID
   */
  public static function token() {
    return sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
        mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ),
        mt_rand( 0, 0x0fff ) | 0x4000,
        mt_rand( 0, 0x3fff ) | 0x8000,
        mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ) );
  }
}